package com.poizon.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.poizon.entity.MomentComment;
import com.poizon.entity.RecordMoment;
import com.poizon.vo.MomentCommentVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ClassName MomentCommentDao
 * @Author NoCheng
 * @Date 2022/1/5 21:06
 * @Description:TODO 动态评论信息
 */

public interface MomentCommentDao extends BaseMapper<MomentComment> {
    @Select("select i.face, i.nickname, " +
            " c.id, c.userinfo_id, c.comment_content, c.comment_time, c.likes_number" +
            " from t_userinfo i inner join t_moment_comment c " +
            " where c.moment_id = #{id} order by c.comment_time desc")
    @ResultType(MomentCommentVo.class)
    List<MomentCommentVo> queryComment(Long id);
}
